package com.enzo.prms.job;

import java.util.Map;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.enzo.prms.common.util.MailUtil;


public class TaskRemind implements Job{

	@Override
	public void execute(JobExecutionContext ctx) throws JobExecutionException {
		String fullName=ctx.getJobDetail().getFullName();
		String name=ctx.getJobDetail().getName();
		JobDataMap dataMap=ctx.getJobDetail().getJobDataMap();
		String note=dataMap.getString("detail");
		String subject="任务提醒-"+note;
        String to="enzocq@163.com";
        StringBuilder msg=new StringBuilder();
        msg.append("以下任务已到期<br/>");
        msg.append("fullName:"+fullName+"<br/>");
        msg.append("name:"+name+"<br/>");
        try {
			MailUtil.sendHtmlEmail(subject, msg.toString(), to);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	

}
